package com.training.java.core.inheritance;

/**
 * This subclass 'CricketPlayers' has derived from the super class ' player'
 * 
 */
	public class CricketPlayers extends Player {

//
		private String captain ;
		
// constructor

	
	CricketPlayers(String nameOfPlayer, int number, String status) {
		super(nameOfPlayer, number, status);
	}

// methods calling from superclass and overriding the start()

	boolean start()
	
			{
				super.start();
				System.out.print("I'm cricket player *** "+ isStarted());
				return isStarted();
				
			}

	void stop()
	{
	super.stop();
	System.out.println("I can't play any more  ");
	}
	
// special methods of cricket players

  String bowl()
 { 
		
	 
	if (isStarted() == true && getName().equals("Satish") )
	 	{
	
		System.out.println(" This player is a Captain"+ captain);
		return captain;
	 	}
    else if (isStarted() == true && !getName().equals("Batsman"));
    
     {
    	       System.out.println("Not a Captain =" + captain); 
    
     }
     
	return captain;
	
	
//getter method and setter method to captain instant variable.
	
/*	public String getCaptain()
	{
		return captain;
	}

	public void setCaptain(String captain)
	
	{
		this.captain = captain;
	}


 }*/
  
}}
    
 

	
	
	
	
	